/*
 * Copyright 2009 Gary Brown
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *
 * Change History:
 * 7 Mar 2009 : Initial version created by gary
 */
package org.betonthemove.platform;

public interface BettingPlatform {

	public void login(String username, String password)
				throws BettingException;
	
	public void logout() throws BettingException;
	
	public AccountFunds getAccountFunds() throws BettingException;
	
	public String getCurrency() throws BettingException;
	
	public java.util.List<EventType> getEventTypes()
				throws BettingException;
	
	/**
	 * This method returns the list of markets associated with the
	 * supplied event type id. If a positive number of lookahead days
	 * is defined, then the events will occur before that number of
	 * days. If a list of countries is defined, then only events
	 * related to those countries will be returned (country codes
	 * using the ISO3 country code standard).
	 * 
	 * @param eventTypeId The event type id
	 * @param daysLookahead The days to lookahead (0 if not used)
	 * @param countries The list of country codes. If empty then
	 * 					all countries are relevant.
	 * @return The market hierarchy
	 * @throws BettingException Failed to get markets
	 */
	public MarketGroup getMarkets(int eventTypeId,
			int daysLookahead, java.util.List<String> countries)
				throws BettingException;

	public java.util.List<MarketGroup> getSubGroups(MarketGroup group)
									throws BettingException;
	
	public java.util.List<Market> getMarkets(MarketGroup group)
									throws BettingException;
	
	public MarketDetails getMarketDetails(int marketId,
					boolean updateOnly) throws BettingException;

	public java.util.List<Bet> getBets() throws BettingException;
	
	public Bet placeBet(int marketId, int entrantId, boolean back,
				double odds, double stake) throws BettingException;
	
	public void cancelBet(long betId) throws BettingException;
	
}
